Power interface for peripheral devices

ABSTRACT

An interface (12) is disclosed for coupling a peripheral device (18) to the serial port (14) of a computer (16). In one application, the interface allows the serial port to provide the power required by a scanner for operation. To reduce power consumption, the scanner is typically operated in either a reduced-power, nonscanning mode or a higher power scanning mode. The interface may include an energy storage device (36) for storing energy from the serial port when the scanner is operated in the nonscanning mode and providing energy to the scanner when it is operated in the scanning mode. Thus, a scanner that requires more power than the serial port can provide at any one time can be used. The interface also includes a shutdown circuit (46) that prevents the scanner from being operated in conditions that might lead to the erroneous interpretation of data. Further, an input leakage isolation circuit (48) is included to prevent the discharge of the storage device when the scanner is not in use.

FIELD OF THE INVENTION

This invention relates generally to peripheral devices for use withcomputers and, more particularly, to the powering of such peripheraldevices.

BACKGROUND OF THE INVENTION

A wide variety of peripheral devices have been developed for use withcomputers. In that regard, many peripheral devices, such as magneticstripe readers and mice, are used to provide information to a hostcomputer. Other peripheral devices, such as printers and monitors, areused to process the output of the host computer. Nearly all suchperipheral devices, however, require some form of power for properoperation.

One particular type of peripheral device of interest is used with a hostcomputer to process bar codes. A bar code is a sequence of alternatingbars and spaces that is typically applied to a product or its packaging.The bar code contains information about the product in a form that canbe quickly and easily processed by specially designed bar code"readers."

Usually, the widths of the various bars and spaces determine theinformation "encoded" in the bar code. For example, this approach iswidely employed in a format known as the Universal Product Code (UPC).Typically, the bar code identifies the product and further processing isrequired to associate additional information, such as price andinventory data, with the product.

As noted above, the information contained in a bar code is "decoded" bya bar code reader. Bar code readers perform two basic functions. First,the bar code reader produces an electrical signal having at least oneparameter that varies with the width of the bars and spaces in the barcode. Typically, this parameter is the duration of alternating low andhigh signal intervals associated with the bars and spaces.

The second function of the bar code reader is the decoding of theelectrical signal. For example, the durations of the alternating low andhigh signal intervals are analyzed to determine which characters thesignal and, hence, bar code represents.

To accomplish these functions, conventional bar code readers include anoptical scanner and a decoder. The scanner includes a light source andphotodetector that may, for example, be physically moved across the barcode by an operator. The light source sequentially illuminates the barsand spaces being scanned. The photodetector, in turn, produces anelectrical output whose magnitude is proportional to the lightreflected. Because the bars generally absorb light, while the spacesgenerally reflect light, the photodetector output alternates betweenhigh and low intervals, with the duration of each interval being afunction of the width of the corresponding bar or space scanned.

The decoder typically includes both hardware and software componentsthat cooperatively perform several functions. First, the decoderprocesses the photodetector output to determine the relative widths ofthe bars and spaces in the bar code scanned. Then, the decoder uses thiscoded information, along with the correlations between bar and spacewidths and character coding for the bar code symbology adopted, todecode the character message encoded into the bar code.

In the preceding discussion, a bar code reader is described as includingboth a scanner and a decoder. As will be appreciated, however, thedecoding operation can be performed either independently of, or onboard, the scanner. Thus, for the purposes of this document, the term"scanner" will be understood to encompass devices responsible forscanning, regardless of whether they are also responsible for decoding.

Having briefly reviewed the operation of bar code readers or scanners,one particular aspect of peripheral operation, the supply of peripheralpower, will now be considered in greater detail. In that regard, usingbar code scanners again for illustrative purposes, the powerrequirements of such scanners have been met in a variety of differentways.

For example, scanner power is often provided externally. In that regard,when decoding is performed remotely from the scanner, the decoder mayinclude a power source designed specifically to power the decoder andthe scanner. This power source may be, for example, a battery or aregulated supply. While the use of external power in this manner reducesthe size and weight of the scanner, it requires a specially designeddecoder power supply.

As an alternative, a power source, such as a battery, could be includedas part of the scanner. The use of a battery, however, has severaldisadvantages. First, a battery may increase the weight and size of thescanner. In addition, a battery is typically able to operate the scannerfor only limited periods before replacement or recharging is required.

A number of techniques have also been suggested for reducing the powerrequirements of the scanner. In that regard, the power applied to thelight source on the scanner may be controlled to minimize powerconsumption. for example, this may be accomplished by reducing the lightsource drive level. However, the reduced light levels may not beaccurately detected by the photodetector, potentially having an adverseeffect on the accuracy of bar code reading. To overcome this limitation,the duty cycle of the light source may instead be controlled.Specifically, the light source can be turned off or operated at a lowduty cycle when the scanner is not being used to scan. As a result, thelight source's power requirements during that time are reduced.

Even with the scanner's power requirements reduced, however, some powersource is still required. Thus, a specially designed external source isneeded to provide the requisite power or the scanner's weight and sizeare increased by the addition of an on-board power source.

As will be appreciated, the power requirements of other peripheraldevices have also been met in a variety of ways. As the trend towardportability in the computer field continues, however, a growing emphasiswill be placed on the need to power peripherals without increasing theperipherals' weight and without requiring specially designed externalsources. In view of these observations, it would be desirable to providea peripheral interface that allows a conventional peripheral device tobe externally powered from another conventional device.

SUMMARY OF THE INVENTION

In accordance with this invention, an interface for coupling the serialport of a computer to a peripheral device that requires energy isdisclosed. The interface includes a transmission element, fortransferring energy from the serial port of the computer, and alsoincludes a storage device, coupled to the transmission element, forstoring energy. The serial port is capable of providing a source amountof power. In one arrangement, the peripheral device is operable in afirst mode requiring less than the source amount of power and in asecond mode requiring more than the source amount of power. The storagedevice stores energy from the serial port when the peripheral device isoperated in the first mode and provides energy to the peripheral devicewhen the peripheral device is operated in the second mode.

A shutdown circuit inhibits the transfer of energy from the serial portto the peripheral device unless the serial port and the storage deviceare able to cooperatively provide enough power to the peripheral deviceto properly operate it in the second mode. Similarly, an isolationcircuit is included to isolate the storage device from input and outputleakage paths in response to at least one of a plurality ofpredetermined conditions. The peripheral device powered may be, forexample, a bar code scanner or a magnetic stripe reader.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will presently be described in greater detail, by way ofexample, with reference to the accompanying drawings, wherein:

FIG. 1 is a block diagram of a system constructed in accordance withthis invention, including a peripheral device, interface, serial port,and computer;

FIG. 2 is a more detailed block diagram of the system of FIG. 1,illustrating, in particular, features of the computer and a bar codescanner employed as the peripheral;

FIG. 3 is a block diagram of a light control circuit, which may beincluded in the bar code scanner of FIG. 2;

FIGS. 4A through 4G illustrate the relationship between the operation ofthe bar code scanner and various components of the interface, referencedto a common time frame;

FIG. 5 is a block diagram of the interface shown in FIG. 1;

FIG. 6 is a more detailed block diagram of the interface shown in FIG. 5illustrating, in particular, a number of features employed by theinterface to control the delivery of power from the computer to theperipheral device;

FIG. 7 is a block diagram of a system constructed in accordance withthis invention in which the peripheral device is a magnetic stripereader; and

FIG. 8 is a block diagram of a system constructed in accordance withthis invention in which the peripheral device is a relay.

DETAILED DESCRIPTION OF THE INVENTION

Referring now to FIG. 1, a computer-based system 10 is shown. The system10 includes an interface 12 constructed in accordance with thisinvention. As will be described in greater detail below, the interface12 performs a number of functions.

In that regard, interface 12 provides power from the serial port 14 of acomputer 16 to a peripheral 18. The interface 12 is designed to allowthe use of a peripheral 18 that requires more power during at least somemodes of operation than is available from serial port 14 at any onetime. In addition, the interface 12 regulates the operation of theperipheral 18 to ensure that peripheral 18 is used only if adequatepower is available, as well as to increase the likelihood that adequatepower will be available. Finally, the interface 12 transfers signalsbetween peripheral 18 and the computer 16.

Addressing now the various components of system 10 in greater detail, aswill be appreciated, peripheral 18 can be any one of a variety ofdevices. Although other peripherals will be discussed in greater detailbelow, in the embodiment shown in FIG. 2, the peripheral 18 is a barcode scanner that includes a light source 22 and photodetector 24.Although other devices such as a laser diode or laser tube could beemployed, the light source 22 is preferably a light-emitting diode (LED)because of the LED's suitable emission characteristics and low powerrequirements. The light source 22 is positioned adjacent a scanningregion of the scanner 18 to allow bar codes to be illuminated when thescanner 18 is moved across them.

The photodetector 24 may be any one of a variety of devices that producean electrical output in response to radiant energy, including, forexample, photoconductive cells, photoresistors and phototransistors. Thephotodetector 24 is typically positioned adjacent light source 22 toreceive light from source 22 after it is reflected by the spaces in thebar code. The output of photodetector 24 is then a train of electricalpulses whose magnitude and duration are a function of the reflectedlight.

Although light source 22 may be left ON when the scanner 18 is not beingused to scan bar codes, the operation of light source 22 is preferablycontrolled during such nonscanning intervals to reduce the scanner'spower requirements. To that end, a light source control circuit 26 maybe included in scanner 18 or, as will be described in greater detailbelow, in interface 12.

The simplest and currently adopted form of light source control circuitis a manual switch 26 connected between interface 12 and light source22. The operator simply actuates switch 26 to turn light source 22 ONprior to scanning and OFF immediately after scanning is complete. As aresult, the power requirements of scanner 18 are substantiallyeliminated during the nonscanning mode of operation.

An alternative to the use of a manual switch is some form of automaticlight control circuit 26. In addition to reducing the power requirementsof the scanner 18, such an automatic circuit 26 must be able to detectthe initiation and termination of a bar code scan. Although theautomatic light control circuit 26 may be constructed in a variety ofways, one arrangement periodically energizes light source 22 during thenonscanning mode of operation and monitors the output of photodetector24 for a transition indicative of the initiation of a bar code scan.When a transition is detected, the light source 22 is then kept ON foran interval of time sufficient to complete scanning of the bar code.

Referring now to FIG. 3, an automatic light control circuit 26 operablein this manner is shown. As shown, the automatic light control circuit26 includes a pulse generator 28, optical pulsing logic circuit 30, andan edge detector 32. These components cooperatively control theoperation of light source 22 and photodetector 24 in the followingmanner. The pulse generator 28 produces a train of electrical pulses ofshort duration as shown in FIG. 4A. This pulse train is applied to theoptical pulsing logic circuit 30 and the edge detector 32.

The optical pulsing logic circuit 30 responds to the pulse train byproviding a "scanner enable" output to the light source 22. When scanner18 is in the non-scanning mode of operation, the scanner enable output,shown in FIG. 4B, is identical to the pulse generator output. Thus, thelight source 22 is turned ON and OFF at the same frequency as the pulsetrain produced by pulse generator 28. The operation of light source 22is shown graphically in FIG. 4C.

Assuming that the light source 22 and photodetector 24 of scanner 18 arenot positioned adjacent a reflective surface prior to scanning, thephotodetector 24 does not respond to the energization of light source 22when the scanner 18 is in the nonscanning mode of operation, as shown attimes t₀ and t₁ in FIG. 4D. For example, with the scanner 18 held infree space prior to use, no reflections will be received byphotodetector 24. If the scanner 18 is then placed on a reflectivesurface, such as the white paper adjacent the beginning of the bar codeto be scanned, the next energization of light source 22 at time t₂ willcause the output of photodetector 24 to undergo a transition, as shownat time t₂ in FIG. 4D.

The edge detector 32 samples the output of scanner 18 to detect suchtransitions in the following manner. To allow the output ofphotodetector 24 to stabilize after the light source 22 has beenenergized, the samples of the photodetector's output are preferablytaken near the end of the time during which light source 22 isenergized, for example, at the falling edge of the enable pulse providedby circuit 30 to light source 22. Edge detector 32 then compares theoutput of photodetector 24 during consecutive samples. Anyblack-to-white or white-to-black transitions occurring in the field thatphotodetector 24 is exposed to between energizations of light source 22will cause the photodetector 24 output to undergo a high-to-low orlow-to-high transition. The edge detector 32 responds to either or bothtypes of such transitions by producing an "edge detected" output, shownin FIG. 4E, that is applied to the optical pulsing logic circuit 30.

Logic circuit 30, in turn, responds to the edge-detected output bygenerating a wand-enable pulse of sufficient duration to allow the barcode to be scanned under most circumstances (beginning at time t₂ inFIG. 4B). Thus, the scanner 18 will enter a scanning mode of operation,as shown in FIG. 4G, and the light source 22 will remain ON at time t₂in FIG. 4C, rather than being pulsed at the output frequency of thepulse generator 28. With the light source 22 left ON, the output ofphotodetector 24, shown in FIG. 4D, will now comprise a sequence of highand low intervals, the duration of which corresponds to the width of thebars and spaces scanned.

To help ensure that the light source 22 is kept ON for a sufficientduration to complete scanning, when the output of photodetector 24indicates that the first edge of the bar code has been scanned, the edgedetector 32 and optical pulsing logic circuit 30 cooperatively produceand respond to an "automatic retrigger enable" signal. This signalautomatically retriggers the longer duration wand-enable pulse producedby the optical pulsing logic circuit 30 for each black-to-white bar codeedge that is detected. As a result, the light source 22 will be certainto remain ON the entire length of the bar code and will, in fact, stayON for a brief interval after scanning is completed.

The final component of scanner 18 to be considered is the decoder 34,shown in FIG. 2. For the purpose of the ensuing discussion, however, thelocation of the decoder 34, like that of the light source controlcircuit 26, in system 10 is not important. In that regard, as describedbelow, the decoder may alternatively be included in the interface 12 orcomputer 16.

The decoder 34 is a microprocessor-based device that receives thephotodetector 24 output, which is a train of electrical pulsescorresponding to the bars and spaces of the bar code scanned. Decoder 34then determines the duration of the various signal intervals and employsa protocol stored, for example, in firmware or battery-backedrandom-access memory to identify the alphanumeric characters encoded bythe bar code. The decoder 34 provides an output to interface 12 that iselectrically, optically, or audibly encoded in any one of a number ofcharacter-encoding formats, such as the the American Standard Code forInformation Exchange (ASCII) format. If, on the other hand, the decoder34 is not included on scanner 18, the unformatted pulse train output byphotodetector 24 will be applied directly to interface 12.

The computer 16 may be, for example, a personal computer (PC) of thetype produced by the International Business Machine Company (IBM), orsome other compatible disk-operating system (DOS) based computer. Thecomputer 16 may, for example, be a standard desktop machine or aportable or laptop device. The computer 16 is responsible for performinga variety of functions, including the control and interpretation of thescanner output. For example, if computer 16 receives decoded informationfrom interface 12 identifying the product to which the bar code beingscanned is attached, computer 16 can then access its memory and softwareto identify other product parameters, such as price and inventory.

As noted above, the computer 16 may include a decoder 36, as analternative to the inclusion of a decoder in interface 12 or scanner 18.In this preferred implementation, the input to computer 16 is not in acharacter-encoded format but is rather a string of pulses representativeof the bars and spaces scanned. The decoder 36 then decodes the productinformation contained in the scanner 18 output and makes it available tothe computer 16 in the particular character-encoding format employed.

As previously discussed, conventional serial communication bar codereaders perform both scanning and decoding of bar codes. The decodedcharacters are then transmitted from the reader to the serial port ofthe host computer in the particular character encoding format used.

In contrast, with the decoding function performed by a decoder 36 incomputer 16, the serial port 14 is used as a direct input/output (I/O)connection between the computer 16 and the combination of scanner 18 andinterface 12. In that regard, the unformatted pulse train output ofscanner 18 is directly applied to an input handshaking line of serialport 14. The decoder 36, which may be, for example, a software driverresident in the memory of computer 16, then responds to an output ofscanner 18 representative of a color change in the material beingscanned by scanner 18 and records the timing values of the various barsand spaces in the bar code being scanned. As will be appreciated, bydelegating responsibility for decoding to a decoder 36 in computer 16,the cost and complexity of the scanner 18 and interface 12 areadvantageously kept low.

Turning now to a discussion of serial port 14, the serial port 14 may bemounted on an input/output (I/O) board or the mother board of computer16. The serial port 14 may be used with a wide variety of equipment,including serial printers, asynchronous modems, and mice. The serialport 14 is most often employed in an RS-232 configuration.

The serial port 14 is controlled by, for example, software resident incomputer 16. In that regard, the resident software sets and leaves theserial port's output handshaking lines high for use as a power source,as will be described in greater detail below. In addition, the softwarepolls one of the serial port's input handshaking lines so that data,such as the timing information from an undecoded pulse train output byphotodetector 24, can be received.

In the RS-232 configuration, serial port 14 may include a conventional25-pin or 9-pin serial connector in which different pins are assignedthe following inputs: chassis ground, transmit data (TXD), receive data(RXD), request to send (RTS), clear to send (CTS), data set ready (DSR),signal ground, carrier detect (CD), data terminal ready (DTR), and ringindicate (RI). The TXD pin and corresponding line of serial port 14 arenormally used to provide signal outputs from serial port 14 to aperipheral device, while the RTS and DTR pins and corresponding lines ofserial port 14 are used for output handshaking. Similarly, the RXD pinand corresponding line of serial port 14 are normally used to providesignal inputs to serial port 14 from a peripheral device, while the CTSand DSR pins and corresponding lines of serial port 14 are used forinput handshaking.

As will be described in greater detail below, in accordance with thepresent invention, the milliampere-level current sourced by the TXD pinis conditioned to provide an "on-board" negative rail voltage, and thecurrents sourced by the RTS and DTR pins are conditioned to provide anon-board positive rail voltage, from serial port 14 to the interface 12and scanner 18. In addition, the outputs of the TXD, RTS, and DTR pinscan be analyzed by interface 12 to determine whether serial port 14 hasbeen reconfigured by computer 16, or whether the computer 16 has beenturned off or the interface 12 disconnected. The RXD, CTS, DSR, CD, andRI pins of port 14 are used to provide data from interface 12 tocomputer 16. More particularly, if decoding is performed by the computer16, the unformatted pulse train produced by the photodetector is appliedto the CTS, DSR, CD, or RI pin. On the other hand, the RXD pin is reliedupon to transmit data in the applicable character-encoded format whendecoding is performed at the scanner 18 or interface 12.

Turning finally to a discussion of the interface 12, interface 12 isincluded to couple the serial port 14 of computer 16 to the bar codescanner 18. Interface 12 is primarily responsible for providing power tothe bar code scanner 18. As shown in FIG. 5, the interface 12 includesan optional light source control circuit 38, a power conditioner 40,serial port interface 42, energy storage device 44, output powershutdown circuit 46, input leakage isolation circuit 48, optics enablecircuit 50 and an optional decoder 52.

Addressing these components individually, the light source controlcircuit 38, as mentioned above, is optional. In that regard, controlcircuit 38 can be used in place of a light source control circuit 26 inscanner 18 if and when the light source 22 is to be controlled duringthe nonscanning mode of operation to reduce power consumption. If thecontrol circuit 38 is not employed, the optics enable circuit 50 is onlyregulated by the shutdown circuit 46, described in greater detail below.

In the preferred arrangement, however, the light control circuit 38 ispart of interface 12 and includes a pulse generator 54, optical pulsinglogic circuit 56, and an edge detector 58, as shown in FIG. 6. Thesecomponents cooperatively control the operation of light source 22, viaoptics enable circuit 50, and photodetector 24 in the same manner as thelight source control circuit 26 discussed above in connection with FIGS.3 and 4.

Addressing now the more important components of interface 12 shown inFIG. 6, the power conditioner 40 receives milliampere-level currentsfrom the RTS and DTR lines of serial port 14 and conditions them toprovide on-board positive rail voltages ranging anywhere from plus fivevolts to plus fifteen volts. Similarly, power conditioner 40 receivesand conditions current from the TXD line of serial port 14 to provideon-board negative rail voltages ranging from minus five to minus fifteenvolts. These on-board rail voltages are filtered and used to drive thedata signals sent by the interface 12 back to computer 16 on the RXDline of serial port 14. In addition, a reduction of the positive railvoltage is performed at regulator 41 to yield a five-volt supply linerequired to power the light source control circuit logic 38.

As shown in FIG. 6, power conditioner 40 also includes three diodes D1,D2, and D3 to protect various portions of the circuit under certaincircumstances. More particularly, assume that a high signal is presenton both the RTS and DTR lines of serial port 14. With the positive sidesof diodes D1 and D2 connected to the RTS and DTR lines, as shown, diodesD1 and D2 will be forward biased, allowing the high signals on the twolines to cooperatively form the positive rail voltage. In the event thatthe signal present on, for example, the RTS line goes low, however,diode D1 will become reverse-biased, preventing the high signal presenton the DTR line from damaging the RTS line. Diode D2 similarly protectsthe DTR line in the event that the signal present on the DTR line goeslow when the signal present on the RTS line is high. Diodes D1 and D2further protect the remainder of interface 12 in the event that either,or both, of the signals on the RTS and DTR lines go low, by effectivelyisolating the interface 12 and the respective line or lines.

Like diodes D1 and D2, diode D3 is included to protect one of the serialport lines, as well as the interface 12. In that regard, the negativeside of diode D3 is connected to the TXD line. As long as the signal onthis line is low, diode D3 is forward biased and will allow the TXD lineto provide the negative rail. In the event the signal present on the TXDline goes high, however, diode D3 will become reverse-biased and willisolate and protect the TXD line and remainder of the interface 12.

As shown in FIG. 6, the power conditioner 40 also includes a fourthdiode D4. Diode D4 is included to allow the TXD line to temporarilycontribute to the positive rail voltage under certain circumstances. Aswill be described in greater detail below, the RTS and DTR lines areresponsible for powering the bar code scanner 18 by providing energyboth directly to scanner 18 and, in some instances, to storage device 44for later transfer to scanner 18. It takes some finite time, however,for the RTS and DTR lines to charge device 44 to a voltage sufficient toproperly power the scanner 18. This time can be reduced by roughly 50percent by temporarily providing a high signal on the TXD line, using itto add power to the positive rail until the storage device 44 issufficiently charged. Diode D4 allows the positive current availablefrom the high signal on the TXD line to flow to the positive rail,rather than the negative rail.

To understand the manner in which the TXD line is used to enhance thepower available from the positive rail of power conditioner 40, it mustfirst be recognized that the signal present on the TXD line of an"IBM-compatible" serial port is not a standard port bit and, therefore,cannot be explicitly set to a high value. The normal "at-rest" value ofthe signal on the TXD line is negative and it goes positive only duringthe high portions of a transmitted RS-232 character. As a result, theonly way to provide the desired high signal on the TXD line is by usingit for some sort of character transmission.

In an interrupt-based approach for producing the desired signal on theTXD line, a software driver resident in the memory of computer 16detects when the storage device 44 is inadequately charged by, forexample, monitoring a comparison of the stored voltage and a referencevoltage that is made by the shutdown circuit 46 and described in greaterdetail below. If device 44 is not sufficiently charged, the softwaredriver will send a 0 hexadecimal character (0H) to the transmit bufferof the computer's serial port controller, which will subsequently causethis character to be transmitted via the TXD line. With the properserial port parity setting, the resultant bit pattern will be all"zeroes" and will form a single high pulse, having a length that dependson the baud rate in effect. The software then enters a "wait" loop,allowing the RTS, DTR, and TXD lines to cooperatively and more rapidlycharge the storage device 44.

In the event that the storage device 44 becomes sufficiently chargedpart way through this wait loop, the software controller will abort theloop. On the other hand, if the wait loop has been completed and theentire assigned character transmitted on the TXD line in this fashion, a"transmit buffer empty" interrupt is produced by serial port 14,indicating to the software driver that the character has beentransmitted. If the storage device 44 is still not sufficiently charged,the software driver then sends another character to the serial portcontroller, repeating the process outlined above until the storagedevice 44 is charged.

As will be appreciated, it is eventually important to restore the TXDline to normal operation because, when the TXD line is used in themanner described above to provide a more powerful positive rail, thepower conditioner 40 is unable to provide a negative rail voltage.Without the negative rail, scanning could not be performed because bothpositive and negative rail voltages are required to output a pulse trainrepresentative of the scanned data back to the serial port 14 ofcomputer 16. However, a more sophisticated version of theinterrupt-based scheme described above takes advantage of the fact thatthe demands on the negative rail are less severe than those on thepositive rail.

In that regard, it is possible to continue sending the signal on the TXDline high for some fraction of time sufficient to augment the currentavailable from the positive rail, while still providing ample current tothe negative rail. For example, the hexadecimal bytes "AA" and "55" areboth bit patterns of alternating "ones" and "zeroes." Outputting eitherof these bytes will therefore reduce the current available on thenegative rail by 50 percent, and increase the current available on thepositive rail accordingly. Depending upon the relative powerrequirements of the two rails, other characters could be transmitted toachieve the desired distribution of power from the TXD line to thepositive and negative rails.

As will be appreciated, although an interrupt-based approach isdescribed above, polling and timing-based methods could also beemployed. In the polling method, the software driver would examine theserial port 14 to determine if the previous character has finishedtransmitting. If it has, another character is transmitted. In thetiming-based method, the software driver determines how long it willtake for the character to transmit. The software driver then simplyrequests the transmission of another character.

Returning now to a discussion of the other components of serial port 14,the serial port interface 42 couples the scanner output signals frominterface 12 to the inputs of the serial port 14 of the computer 16.Depending on whether a decoder is included with scanner 18 or interface12, or is instead included as part of computer 16, the serial portinterface 42 may transmit character-encoded data on the RXD line ofserial port 14 or a pulse train corresponding to the bars and spaces inthe bar code scanned on one of the handshake lines CTS or DSR.

The energy storage device 44 of interface 12 is included to allow thescanner 18 to operate properly, even if it requires more power during ascan than the serial port 14 can continuously provide. As previouslydescribed, the scanner's light source 22 may be completely deactivatedor operated in a pulsed mode until the scanner 18 is positioned adjacentthe white paper preceding a bar code to be scanned, at which time thelight source 22 in scanner 18 is kept ON. As will be appreciated from,for example, FIG. 4C, scanner 18 thus requires some first level ofpower, P₁, when operated in the nonscanning mode and a higher level ofpower, P₂, when operated in the continuous scanning mode.

These power requirements of scanner 18 may have any one of threerelationships to the power available from serial port 14. For example,the power available from serial port P_(S) may be greater than both P₁and P₂ (Case 1). In this situation, the serial port 14 is able todirectly supply scanner 18 with all the power it needs, regardless ofits mode of operation. As a result, the storage device 44 is notrequired.

Alternatively, the power P_(S) available from serial port 14 may begreater than the power P₁ required by scanner 18 in the nonscanningmode, but less than the power P₂ required by scanner 18 in the scanningmode of operation (Case 2). In this situation, the serial port 14 cannotdirectly provide enough power to scanner 18 to ensure proper operationof scanner 18 when a scan is in progress. To overcome this limitation,the storage device 44 is included to store the energy from serial port14 that is not required by scanner 18 when scanner 18 is operated in thenonscanning mode. The storage device 44 then supplements the energyavailable from serial port 14 during scanning by returning this storedenergy to scanner 18 to make up for the energy deficiency that wouldotherwise occur when scanner 18 is in the scanning mode. The interface12 finds perhaps its greatest applicability to this case.

As yet another alternative, the power P_(S) available from the serialport may be less than the power P₁ or P₂ required by scanner 18 ineither the nonscanning or scanning modes (Case 3). In this situation, itis still possible for the storage device 44 to store energy from serialport 14 if the scanner 18 is placed in a shutdown mode in which it drawsno power from the serial port 14 at all. Then, with the storage device44 sufficiently charged, energy from device 44 can be used to supplementthe power provided by serial port 14 to operate scanner 18 in either thescanning or nonscanning modes.

Having reviewed the basic operation of storage device 44, its structurewill now be briefly considered. In the preferred embodiment, storagedevice 44 comprises one capacitor, or a plurality of capacitorsconnected in parallel, with the positive terminal of the capacitor orcapacitors coupled to the connection between the input power isolationcircuit 48 and shutdown circuit 46 and the negative terminal of thecapacitor or capacitors coupled to ground. As a result, the capacitorsare coupled to the power transmission path between serial port 14 andscanner 18. The size and construction of the capacitors required is afunction of the characteristics of serial port 14 as well as therelative power levels P₁, P₂, and P_(S) involved.

As will be appreciated, other storage devices 44 could be employed,including, for example, a rechargeable or nonrechargeable battery orbatteries. By supplementing battery power via the serial port 14, thebattery requirements and, hence, scanner 18 size and weight can bereduced.

As noted, the output of the storage device 44 is directly connectedbetween the serial port 14 and scanner 18. As a result, energy notrequired by scanner 18 is "automatically" stored by the storage device44. Similarly, energy from storage device 44 is directly available tothe light source 22. If desired, however, storage device 44 could becontrollably coupled to the power transmission path between serial port14 and scanner 18 by, for example, the light source control circuit 38.Thus, for example, circuit 38 could be constructed to selectively couplestorage device 44 to the power transmission path in Cases 2 and 3 above,while disconnecting storage device 44 in Case 1 where it is notrequired.

Turning now to a discussion of the shutdown circuit 46, it is includedto ensure that scanner 18 is operated only if accurate scans can beperformed. If serial port 14 can directly supply the power required byscanner 18 in both the scanning and nonscanning modes of operation (Case1), shutdown circuit 46 is not required. If, however, the scanner 18requires more power than the serial port 14 can provide directly (Cases2 and 3), the scanner 18 will not operate properly unless additionalenergy is available from storage device 44. Thus, shutdown circuit 46 isincluded to determine when storage device 44 is unable to ensure properoperation of scanner 18 and to inhibit the operation of scanner 18 inthat event. As will be appreciated, the interface 12 would typically beconstructed so that shutdown circuit 46 would only rarely be required toinhibit the operation of scanner 18, for example, when the same bar codeis scanned repeatedly, and not during normal expected use.

The shutdown circuit 46 may be constructed in a variety of ways toensure that adequate energy is available from storage device 44. Forexample, as shown in FIG. 6, the shutdown circuit 46 may include avoltage comparator 60, normally closed switch 62, and OR gate 63.Basically comparator 60 determines whether the voltage V_(c) stored on acapacitive storage device 44 has fallen below some threshold levelV_(th1) required to ensure proper operation of scanner 18.

For the Case 2 embodiment, this is shown graphically in FIG. 4F. If thecapacitor voltage V_(c) falls below the threshold voltage V_(th1)provided by a reference source 61, the comparator 60 provides an outputthrough OR gate 63 to switch 62, opening switch 62 and preventingcurrent from flowing to the light source 22 and other components ofscanner 18. At this point, comparator 60 continues monitoring thecapacitor voltage V_(c). Once voltage V_(c) rises to a second thresholdvoltage V_(th2), the normally closed switch 62 is again closed, allowingscanner 18 to resume operation.

As an alternative to the use of comparator 60, circuit 46 may include acounter and timer. In this approach, the counter keeps track of thenumber of scans performed during a set interval of time, defined by thetimer. If some predetermined count is exceeded, the normally closedswitch 62 is opened, preventing scanner 18 from operating. Thisapproach, however, is more complicated in that it requiresinitialization and resetting of the counter and timer.

As a third approach, a processor for performing one of a variety ofconventional error detection schemes could be included in circuit 46.More particularly, the processor would monitor the photodetector outputto determine whether the bar code data received is correct or whether itincludes some error, indicating that the scanner 18 should be disabled.As a result, the normally closed switch 62 would be opened, inhibitingthe operation of scanner 18. After a predetermined interval of timesufficient to allow recharging of the storage device 44, the normallyclosed switch 62 would then be closed.

Turning now to the input leakage isolation circuit 48, this circuit 48is included to isolate storage device 44 from input leakage paths. As aresult, the discharge of storage device 44 is minimized, reducing thecharge-up time for the storage device 44 before the scanner 18 may beused.

To that end, the input leakage isolation circuit 48 includes acomparator 64 that determines, for example, when the computer 16 hasbeen turned OFF, when the interface 12 has been disconnected fromcomputer 16, or when the serial port 14 of computer 16 has beenreconfigured. This is accomplished by comparing the input from serialport 14 to a reference voltage from the power conditioning block 40 todetect the absence of positive power on one or both of the RTS or DTRlines. Each of the three conditions monitored indicates that the scanner18 cannot be immediately used to provide proper data to computer 16. Asa result, the comparator 64 opens a normally closed switch 66, alsoincluded in circuit 48, to interrupt the input to storage device 44.Then, when computer 16 is turned back ON, interface 12 is reconnected,or serial port 14 reconfigured, the normally closed switch 66 willreconnect the input to storage device 44.

The shutdown circuit 46 also responds to drops in voltage occurring whenthe computer 16 has been turned OFF, when the interface 12 has beendisconnected from computer 16, or when the serial port 14 of computer 16has been reconfigured. More particularly, the output of the comparator64 in isolation circuit 48 is applied to the OR gate 63 of shutdowncircuit 46 to open the normally closed switch 62 under these conditions.As a result, the shutdown circuit 46 operates as an output leakageisolation circuit, isolating storage device 44 from output leakagepaths. By virtue of its inclusion of OR gate 63 to couple the outputs ofcomparators 60 and 63 to switch 62, switch 62 remains closed andprovides power to the optics enable circuit 50 only if the storagedevice 44 is adequately charged and leakage will not be a problem.

As will be appreciated from the preceding discussion, the input leakageisolation circuit 48 and shutdown circuit 46 cooperatively isolatestorage device 44, ensuring that the energy stored by device 44 ispreserved and minimizing the likelihood of, and length of time requiredfor, an initial charge-up period. Otherwise, several minutes might berequired to charge storage device 44 to a level that is sufficient topermit scanning to proceed. In addition, any energy previously drawnfrom the serial port 14 of computer 16 is not wasted.

As noted previously, the interface 12 may, as an alternative to computer16 or scanner 18, include a decoder block 52. In that case, a train ofelectrical pulses corresponding to the bars and spaces in a scanned barcode is output by photodetector 24 to interface 12, where it is decodedby decoder 52 and converted to the applicable character-encoded format.The data in this format are then provided to the RXD line of serial port14 by the serial port interface 42 of interface 12.

In summary, the disclosed interface 12 allows the peripheral 18 to bepowered directly from the serial port 14 of a computer 16. In addition,the interface 12 is designed to allow the use of a peripheral 18 thatrequires more power, while in its high current consumption mode ofoperation, than the serial port 14 can directly provide. Further, theinterface 12 limits the operation of peripheral 18 in situations thatmight result in improper operation and ensures that the interface 12 isready for operation when the peripheral 18 is to be used.

As noted previously, other peripherals 18, subject to operationallimitations that are similar to those of the bar code scanner discussedabove, may also be included in system 10. For example, as shown in FIG.7, peripheral 18 may be a magnetic stripe scanner, which includes amagnetic head 68 for processing information that is magnetically codedupon magnetic strips. Like the bar code scanner, magnetic stripe scanner18 may decode such information itself, or may rely upon interface 12 orcomputer 16 for decoding.

The magnetic stripe scanner 18 may also be designed to operate inseveral different modes. For example, scanner 18 may be operated in anonscanning mode in which the scanner requires little or no power. Then,in response to the manual actuation of a switch by an operator, or inresponse to the sensed initiation of a magnetic stripe scan, the scanner18 may be operated in a scanning mode at a higher power level.

As will be appreciated from the discussion of bar code scanners above,the interface 12 provides the requisite power to scanner 18, even whenthe scanning mode of operation requires more power than is continuouslyavailable. The interface 12 also passes the coded or decoded informationcontained on scanned magnetic stripes to computer 16 for processing.

In addition to input-type peripherals 18, such as the bar code andmagnetic stripe scanners discussed above, interface 12 may be used withoutput-type peripherals that respond to signals produced by computer 16.As one example, reference is had to FIG. 8, in which the peripheral 18is a latching-type relay.

As shown, the latching-type relay 18 has a coil or solenoid 70 thatelectromagnetically controls one or more sets of contacts 72 included inthe power circuit of a controlled system 74. The state of the relay 18and, hence, the open or closed position of contacts 72 can be changed byapplying a pulse of energy to the relay solenoid 70 that is relativelysmall in comparison to the energy required by the controlled system 74.As a result, computer 16 can be used to control the power circuit and,thus, operation of the controlled system 74, while remainingelectrically isolated therefrom.

In this arrangement, the solenoid 70 would require no energy until thestate of relay 18 is to be changed. Thus, during this "nonactuation"interval, the storage device 44 in interface 12 would store energy. Thestored energy could then be discharged by storage device 44 to solenoid70 in response to an output from computer 16 on the output control lineof serial port 12. As a result, relay 18 could be placed in an"actuation" mode, switching its output, even when more energy isrequired for switching than is continuously available from serial port12.

Those skilled in the art will recognize that the embodiments of theinvention disclosed herein are exemplary in nature and that variouschanges can be made therein without departing from the scope and thespirit of the invention. In this regard, as was previously mentioned,the interface 12 can be used with a variety of peripheral devices 18. Inaddition, where a scanner 18 is employed as the peripheral, although thedecoder is preferably included in the computer and the light sourcecontrol circuit is preferably included in the interface, the inventionis not dependent upon the location of the decoder in either the scanner18, interface 12, or computer 16, nor is it dependent upon the locationor use of a light source control circuit. The invention is also notdependent upon the operational scheme of scanner 18. Further, as wasnoted, the energy storage device 44, shutdown circuit 46, and powerisolation circuit 48 can be constructed in a variety of different ways.Because of the above and numerous other variations modifications thatwill occur to those skilled in the art, the following claims should notbe limited to the embodiments illustrated and discussed herein.

The embodiments of the invention in which an exclusive property orprivilege is claimed are defined as follows:
 1. An interface, forcoupling a general purpose peripheral port of a computer to a peripheraldevice that requires energy, the peripheral port including at least onecontrol line and one data line, at least one of the control or datalines being capable of providing a source amount of power, theperipheral device being operable in a standby mode requiring somenonzero amount of power less than the source amount of power and in anactive mode requiring more than the source amount of power, saidinterface comprising:transmission means for receiving energy from theperipheral port and transferring it to the peripheral device; andstorage means, coupled to said transmission means, for storing a portionof the energy received from the peripheral port when the peripheraldevice is operated in the standby mode and providing energy to theperipheral device when the peripheral device is operated in the activemode.
 2. The interface of claim 1, further comprising shutdown means forinhibiting the transfer of energy from the peripheral port to theperipheral device unless the peripheral port and said storage means cancooperatively provide enough power to the peripheral device to properlyoperate it in said active mode.
 3. The interface of claim 2, furthercomprising monitoring means for determining whether the peripheral portand storage means can cooperatively provide enough power to theperipheral device to properly operate it in said active mode, saidshutdown means being responsive to said monitoring means.
 4. Theinterface of claim 3, wherein said storage means comprises a capacitorhaving a voltage that is proportional to the energy stored and whereinsaid monitor means is further for monitoring the voltage on saidcapacitor to determine whether the voltage exceeds some predeterminedthreshold.
 5. The interface of claim 3, wherein said storage meanscomprises a battery having a voltage and wherein said monitor meansmonitors the voltage of said battery to determine whether the voltageexceeds some predetermined threshold.
 6. The interface of claim 1,wherein said storage means is exposed to an input energy leakage path,defined between said storage means and said peripheral port in part byone of said control or data lines, and on output energy leakage path,defined between said storage means and said peripheral device, inresponse to a plurality of conditions and wherein said interface furthercomprises isolation means for isolating said storage means from theinput and output leakage paths in response to at least one of saidplurality of conditions.
 7. The interface of claim 6, wherein saidplurality of conditions include a change in the operation of theperipheral port, disconnection of said interface from the peripheralport, and loss of power at the computer.
 8. The interface of claim 1,wherein said peripheral device comprises a bar code scanner.
 9. Theinterface of claim 1, wherein said peripheral device comprises amagnetic stripe scanner.
 10. The interface of claim 1, wherein said atleast one control line and one data line include a first line forproviding a first voltage rail and a second line for providing a secondvoltage rail, said transmission means further comprising means forallowing energy to be transferred from one of the voltage rails to theother of the voltage rails.
 11. The interface of claim 1, wherein theperipheral device is a bar code scanner, the standby mode is anonscanning mode, and the active mode is a scanning mode.
 12. Theinterface of claim 1, wherein said general purpose peripheral port is aserial port.
 13. The interface of claim 12, wherein said serial port isan RS-232 port including TXD, RTS, and DTR lines, said TXD lineproviding a negative rail voltage and said RTS and DTR lines providing apositive rail voltage, cooperatively providing said source amount ofpower.
 14. A method of interfacing a bar code scanner to a generalpurpose peripheral port of a computer, the peripheral port including atleast one control line and one data line, at least one of the linesbeing capable of providing a source amount of power, the scanner beingoperable in a standby mode requiring some nonzero amount of power lessthan the source amount of power and in an active mode requiring morethan the source amount of power, said method comprising the stepsof:providing power required by the scanner through the peripheral port;storing energy from the peripheral port when the scanner is operated inthe standby mode; providing storage energy, and energy from theperipheral port, to the scanner when the scanner is operated in theactive mode; and communicating data representative of bar codes scannedfrom the scanner to the computer through the peripheral port.
 15. Themethod of claim 14, further comprising the step of inhibiting the stepof providing stored energy, and energy from the peripheral port, to thescanner if the stored energy and the energy from the peripheral portcannot cooperatively ensure adequate power to properly operate thescanner in the active mode.
 16. The method of claim 15, furthercomprising the step of electrically isolating the stored energy from theperipheral port and the scanner.
 17. The method of claim 14, wherein theat least one control line and one data line include a first line forproviding a first rail voltage and a second line for providing a secondrail voltage, said step of providing power comprising the step ofproviding the first rail voltage to the scanner.
 18. The method of claim17, further comprising the step of selectively controlling the secondline to allow the second rail voltage to supplement the first railvoltage provided by the first line.